<template>
  <div id="app">
    <div class="menu">
      <el-menu
        :default-active="activeIndex2"
        class="el-menu-demo"
        mode="horizontal"
        @select="handleSelect"
        background-color="#545c64"
        text-color="#fff"
        active-text-color="#ffd04b"
      >
        <el-menu-item index="1">
          <router-link to="/">首页</router-link>
        </el-menu-item>
        <el-menu-item index="2">
          <router-link to="/machineManagement">机器管理</router-link>
        </el-menu-item>
        <el-menu-item index="3">
          <router-link to="/operationalManagement">业务管理</router-link>
        </el-menu-item>
      </el-menu>
    </div>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "app",
  data() {
    return {
      activeIndex: "1",
      activeIndex2: "1"
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      // console.log(key, keyPath);
    }
  }
};
</script>

<style lang='less' scoped>
.el-menu-item {
  width: 200px;
  text-align: center;
  a {
    width: 100%;
    display: inline-block;
  }
}
</style>
